package com.yoyosys.echo.manager.system.costants;

import java.text.SimpleDateFormat;

public class Constant {
//	public static String PROJECT_NAME="YKBI";

//	public static String DEFAULT_USER_PWD="yoyosys";
//	public static String DEFAULT_USER_PHOTO="no-photo.png";
//	public static String SECURITY_KEY="br1sjhhrhl";

	public static final int ADMIN_USER_ID = 131;
	public static final Integer CONSOLE_CAS_USER_NUMBER = 10000;

	public static  final String CONTAINER_STATUS_ONLINE="ONLINE";

	public static String SQL_COLS_KEY = "cols";

	/*解析e_desi_mapping表的xml*/
	public static String id = "id";
	public static String dsTypeId = "dsTypeId";
	public static String transType = "transType";
	public static String sourceName = "sourceName";
	public static String ip = "ip";
	public static String port = "port";
	public static String shared = "shared";
	public static String userName = "userName";
	public static String passWord = "passWord";
	public static String environmentType = "environmentType";
	public static String dbName = "dbName";
	public static String grade = "grade";
	public static String characterEncoding = "characterEncoding";
	public static String containerIp = "containerIp";
	public static String unicodeType = "unicodeType";
	public static String extParams = "extParams";
	public static String nodeType = "nodeType";
	public static String remark = "remark";
	public static String isShared = "isShared";
	public static String encode = "encode";

	//	hbase
	public static String masterIp = "masterip";
	public static String zooHost = "zooHost";
	public static String zooPort = "zooPort";
	public static String config_ext = "config_ext";
	//	es
	public static String serversStr = "serversStr";
	public static String address = "address";
	//	mongo
	public static String mongoDbIp = "mongoDbIp";
	public static String mongoDbPort = "mongoDbPort";
	//kafka
	public static String server = "server";
	public static String topic = "topic";
	public static String version = "version";
	public static String isUseKerberos = "isUseKerberos";
	public static String properties = "properties";
	//	rocketmq
	public static String namesrvAddr = "namesrvAddr";
	public static String producerGroup = "producerGroup";
	public static String tags = "tags";
	//hdfs
	public static String configExt = "configExt";
	//odps tunnel
	public static String accessId = "accessId";
	public static String accessKey = "accessKey";
	public static String endpoint = "endpoint";
	public static String tunnelEndpoint = "tunnelEndpoint";
	public static String projectName = "projectName";
	//ftp
	public static String systemKey = "systemKey";


	/*解析e_desi_workflow表的xml,ip和port与e_desi_mapping一致*/
	public static String stepType="stepType";
//	xml里username为小写
	public static String username="username";
	/*解析e_desi_workflow表的json*/
	public static String nodes="nodes";
	public static String attributes="attributes";
	public static String stepConfig="stepConfig";
	public static String connectId="connectId";
	public static String connectionName="connectionName";
	public static String connUrl="conn_url";
	public static String dataBaseType="dataBaseType";
	public static String schema = "schema";
	public static String tableName = "tableName";
	public static String sql = "sql";
	public static String isSql = "isSql";
	public static String driverClass="driverClass";
	public static String onlyCreateTable="onlyCreateTable";


	public static int ERROR_CODE=-1;
	public static double EXCEPTION_VALUE=-999;
	//营销数据异常值
	public static double EXCEPTION_VALUE_YX=-999999;

	public final static String SUCCESS="SUCCESS";//日志成功状态
	public final static String FAILED="FAILED";//日志失败状态
	public final static String PENDING="PENDING";//日志失败状态
	public final static String WARING="WARING";//警告状态，可通过
	public final static String NOT_EXIST="NOTEXIST";//

	public static String DB_ERROR="数据库异常！";
	public static String DB_INSERT_ERROR="数据库异常，保存数据失败！";
	public static String DB_UPDATE_ERROR="数据库异常，更新数据失败！";
	public static String DB_DELETE_ERROR="数据库异常，删除数据失败！";
	public static String DB_SELECT_ERROR="数据库异常，查询数据失败！";


	/**
	 * console 相关接口地址
	 */
	public static String CONSOLE_LOGIN = "http://%s/user/login";
	public static String CONSOLE_HOST_COUNT = "http://%s/hosts/countHost";
	public static String CONSOLE_SHOW_HOST_INFO_URL_BY_ID = "http://%s/hosts/showHostByIds";
	public static String CONSOLE_SHOW_HOST_GRAPH = "http://ip:port/showGraphs";
	public static String CONSOLE_QUERY_CLUSTER = "http://%s/clusters/queryClusters";
	public static String CONSOLE_QUERY_ALL_SERVICE = "http://%s/getAllServicesByClusterID?cluster_id=%s";
	public static String CONSOLE_QUERY_SERVICE_MACHINE = "http://%s/getAllRolesBaseOnServiceByClusterID?cluster_id=%s&service_id=%s&status=5&service_role_id=0";

	public static enum USER_TYPE{FRONT,BACKEND,CONSOLE};
	public static SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	public static SimpleDateFormat SDF_DB = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
	public static SimpleDateFormat SDF_DAY = new SimpleDateFormat("yyyy-MM-dd");
	public static SimpleDateFormat SDF_PARAM = new SimpleDateFormat("yyyyMMddHHmmss");


	//hdfs ftp ssh url
	public static String HDFS_URL = "hdfs://%s:%s/%s";
	public static String FTP_URL = "ftp://%s:%s/%s";
	public static String SSH_URL = "ssh://%s:%s/%s";


	public static enum DATABASETYPE {
        ORACLE, MYSQL, SQLSERVER, SQLSERVER2005, DB2, INFORMIX, SYBASE,DQE,DATACELL, OTHER, EMPTY
    }

	public static enum MYSQLCOLUMNTYPE {
		TINYINT,SMALLINT,MEDIUMINT,INT,INTEGER,BIGINT,FLOAT,DOUBLE,DECIMAL,NUMERIC,DATE,
		DATETIME,TIMESTAMP,TIME,YEAR,CHAR,TINYBLOB,TINYTEXT,BLOB,TEXT,MEDIUMBLOB,MEDIUMTEXT,
		LONGBLOB,LONGTEXT,ENUM,SET
    }

	//标识，1标识源，2标识转换器，3标识目标
	public static Integer NODE_SOURCE_TYPE = 1;
	public static Integer NODE_TRANS_TYPE = 2;
	public static Integer NODE_TARGET_TYPE = 3;


	//是否发布，0是未发布，1是已发布，默认是0
	public static Integer MAPPING_NO_PUBLISH = 0;
	public static Integer MAPPING_PUBLISH = 1;

	//映射源是否共享，0是未共享，1是已共享，默认是0
	public static Integer MAPPING_NODE_NO_SHARE = 0;
	public static Integer MAPPING_NODE_SHARE = 1;

	//调度是否删除，0是未删除，1是已删除，默认是0
	public static Integer SCHEDUL_NO_LOGIC_DEL = 0;
	public static Integer SCHEDUL_LOGIC_DEL = 1;

	//调度是否运行，0是未运行，1是正在运行，2是分布式运行
	public static Integer SCHEDUL_IS_RUNNING = 1;
	public static Integer SCHEDUL_NO_RUNNING = 0;
    public static Integer SCHEDUL_IS_DISTRIBUTE_RUNNING = 2;
    public static Integer SCHEDUL_IS_FILE_MONITOR_RUNNING = 2;

  /**
	 * 任务类型-kettle，设计器里面添加的kettle转换作业。
	 */
	public static final int JOB_TYPE_KETTLE = 0;

	/**
	 * 任务类型-yoyorepl
	 */
	public static final int JOB_TYPE_YOYOREPL = 1;

	/**
	 * 任务类型-Pipeline(workflow)
	 */
	public static final int JOB_TYPE_WORKFLOW = 2;

	/**
	 * 任务类型-载数/卸数工具
	 */
	public static final int JOB_TYPE_EXPORT_IMPORT = 3;

    /**
     * 任务类型-oss文件传输s
     */
	public static final int JOB_TYPE_OSS = 8;

	/**
	 * 地震台网中新项目使用任务
	 */
	public static final int JOB_TYPE_DRP = 5;

	/**
	 * 任务类型-导入的Pipeline - kettle-job
	 */
	public static final int JOB_TYPE_KETTLE_JOB = 6;

	/**
	 * 任务类型-导入的转换 kettle-trans
	 */
	public static final int JOB_TYPE_KETTLE_TRANS = 7;

	public static final int DEFAULT_PAGE_SIZE = 20;


}
